#ifndef _SWAP_H
#define _SWAP_H

#include <type.h>
#include <fs.h>
#include <ds/list.h>
#include <device/device.h>

struct swap_info {
    u32 swap_id;
    u32 slot;
};

struct swap_device {
    lnode_t list;
    lnode_t queue;
    u32 id;
    u32* swap_map;
    u32 lowest_bit;
    u32 highest_bit;
    u32 pages;
    u32 free_slots;
    device_t* dev;
    file_t* swap_file;
};

struct swap_cache_info {
    lnode_t list;
    page_t* page;
    struct swap_info* info;
};

void set_slot_free(struct swap_device* swap, pg_entry_t* pte);

#endif /* _SWAP_H */